Skip to content

feat(global-index): support hybrid search on data-evolution tables - #590

Open
SteNicholas wants to merge 1 commit into
apache:mainfrom
SteNicholas:PAIMON-407
Open

SteNicholas wants to merge 1 commit into
apache:mainfrom
SteNicholas:PAIMON-407

Conversation

@SteNicholas

Copy link
Copy Markdown
Member

Purpose

Linked issue: close #407

Support hybrid search on Data Evolution tables in Paimon C++, following Paimon Java. Vector and full-text routes search one snapshot with shared partition and row filters. The fused row IDs and scores can drive a table scan that exposes _INDEX_SCORE.

  • Add VectorSearchBuilder, VectorScan and VectorRead for table-level vector top-k. Query shards in parallel, convert Lumina distances to similarity scores and retain the selected snapshot metadata in reusable plans.
  • Add HybridSearchBuilder with weighted vector and full-text routes, per-route candidate limits and a final top-k. Forward vector query options to the backend and resolve columns against the selected schema.
  • Use scalar indexes to narrow candidates before ranking. Verify inexact candidates against table data when configured and oversample vector hits when scalar indexes cannot evaluate the filter.
  • Apply deletion vectors before ranking and skip vector shards without eligible live rows. Reuse the full-text search paths for indexed hits and gaps in index coverage.
  • Fuse hits by row ID with rrf, weighted_score and mrr. Keep the final top-k in a heap and break score ties by ascending row ID.

Table-level vector search supports fast mode. Full-text routes support fast, full and detail.

Tests

  • Ranker tests for the three fusion formulas, route weights, score normalization, tie-breaking, empty routes and invalid weights.
  • Builder tests for route validation, partition and row filters, route options and limits, concurrent shard queries, scalar prefiltering and vector post-filtering.
  • Snapshot tests for historical field IDs, plan reuse after snapshot expiry and a commit between vector and full-text route searches.
  • Lumina and full-text integration tests for global vector top-k, fused _INDEX_SCORE reads, deletion vectors and full-text search over index coverage gaps. Lumina unit tests cover native and similarity scores across distance metrics.

API and Format

  • Add Table::NewVectorSearchBuilder(), Table::NewHybridSearchBuilder(), the vector scan and read interfaces, and HybridSearchRanker. Expose vector search capability through GlobalIndexer and similarity-score requests through VectorSearch.
  • Search reads the existing table, global index and deletion-vector file formats.

Documentation

Yes. docs/source/user_guide/global_index.rst and docs/source/api/global_index.rst cover vector and hybrid search, route configuration, filtering, snapshot selection, rankers and reading the fused scores.

Generative AI tooling

Generated-by: OpenAI Codex (GPT-6)

🤖 Generated with OpenAI Codex

Data-evolution tables exposed per-shard vector hits and full-text
results through separate APIs. Callers had to use the same snapshot
for both searches and fuse the hits before reading the matching rows.

- Add table-level vector top-k. Query shards in parallel and convert
  Lumina distances to similarity scores.
- Reuse vector plans across queries. Resolve snapshot selectors for
  new plans and retain snapshot metadata for reads of existing plans.
- Run weighted vector and full-text routes on one snapshot with shared
  partition and row filters. Apply a candidate limit per route and
  forward vector query options to the backend.
- Use scalar indexes to restrict candidates before ranking. Verify
  inexact candidates from table data when enabled and oversample vector
  hits when no scalar index can evaluate the filter.
- Read deletion vectors for data files overlapping searched ranges
  and skip vector shards without eligible live rows.
- Check query authorization and bind columns to the selected schema.
- Fuse hits by row ID with rrf, weighted_score and mrr. Keep the final
  top-k in a heap and break ties by ascending row ID.
- Cover ranking, filters, shard concurrency, snapshot expiry and scored
  reads in unit and integration tests.
- Document route configuration and how to read fused scores.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support hybrid search with rrf, weighted_score and mrr rankers

1 participant